import { _decorator, Component, Label, Node, Sprite } from 'cc';
import { Soldier } from '../entity/Soldier';
const { ccclass, property } = _decorator;

@ccclass('ArmyLoseItem')
export class ArmyLoseItem extends Component {
    @property(Sprite)
    cover:Sprite   
    @property(Label)
    soldierName:Label   
    @property(Label)
    count:Label
    @property(Label)
    loseCount:Label

    start() {

    }

    async setData(solder:Soldier, count: number, loseCount:number) {
        this.soldierName.string = solder.name
        this.count.string = count + ''
        this.loseCount.string = loseCount + ''
        this.cover.spriteFrame = await solder.getHeadImg()
    }
}


